package cjq.demo.spring.aop1;

import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * author: cjianquan
 * date: 2016/9/13
 */
public class AopTest1 {
    @Test
    public void test_aop1(){
        ApplicationContext appContext = new ClassPathXmlApplicationContext(
                new String[] { "spring-aop1.xml" });

        CustomerService cust = (CustomerService) appContext
                .getBean("customerServiceProxy");

        System.out.println("*************************");
        cust.printName();
        System.out.println("*************************");
        cust.printURL();
        System.out.println("*************************");
        try {
            cust.printThrowException();
        } catch (Exception e) {
        }
    }
}
